<!--
@ 说明: 布局中间下部图框
@ 作者: 阿拉丁矿工 黄传鸿 <hchhyzc@foxmail.com> 
-->
<template>
    <div class="h_layout_middle_down_view">
        <div class="h_down_view_icon_button">
            <!-- 列表 -->
            <div class="h_list_bar">
                <div class="h_button_group" v-for="item in downNavigation">
                    <div class="h_button" :class="[item.frameActive ? 'h_active' : '']" @click="myStore.layoutHandel(item)">
                        {{ item.label }}
                    </div>
                </div>
            </div>
            <div class="h_fold_icon" v-if="downFrameInfo.fold" @click="myStore.layoutHandel('DownFold')">{{
                downFrameInfo.label }}⬇️</div>
            <div class="h_fold_icon" v-else @click="myStore.layoutHandel('DownFold')">{{ downFrameInfo.label }}⬆️</div>
        </div>
        <!-- 下部框 -->
        <div class="h_fold_down_view" :style="{ height: downFrameInfo.range + 'px' }" v-if="downFrameInfo.fold">
            <DownProject v-if="myStore.getDownFrameActive('DownProject')"></DownProject>
            <DownPage v-if="myStore.getDownFrameActive('DownPage')"></DownPage>
            <DownCanvas v-if="myStore.getDownFrameActive('DownCanvas')"></DownCanvas>
            <DownPenContainer v-if="myStore.getDownFrameActive('DownPenContainer')"></DownPenContainer>
            <DownBlockGroup v-if="myStore.getDownFrameActive('DownBlockGroup')"></DownBlockGroup>
            <DownPelAttr v-if="myStore.getDownFrameActive('DownPelAttr')"></DownPelAttr>
        </div>
    </div>
</template>

<script setup lang="ts">

/** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
// 🐸 引入存储
/** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { storeToRefs } from "pinia";
import { useEditorStore } from "../../store"; // 画布

// 🍁  下
import { DownProject } from "../DownProject";
import { DownPage } from "../DownPage";
import { DownCanvas } from "../DownCanvas";
import { DownPenContainer } from "../DownPenContainer";
import { DownBlockGroup } from "../DownBlockGroup";
import { DownPelAttr } from "../DownPelAttr";

/** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
// 🐸 使用存储
/** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
const myStore = useEditorStore(); // 画布
// 解构-存储
let { downNavigation, downFrameInfo, } = storeToRefs(myStore);


/* ================================================================================================ */
//                                函数 ★
/* ================================================================================================ */


</script>

<style lang="scss" scoped>
// 下部导航按钮
.h_layout_middle_down_view {
    margin: 0px;
    padding: 0px;
    width: 100%;
    user-select: none;
    background-color: rgb(0, 0, 0);
    display: flex;
    flex-direction: column;
}

.h_down_view_icon_button {
    height: 30px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.h_fold_icon {
    height: 30px;
    width: 150px;
    background-color: rgb(80, 80, 80);
    text-align: end;
    font-size: larger;
    color: #1d9f00;
    cursor: pointer;

    &:hover {
        color: #f9f9f9;
    }
}

// 页面列表条
.h_list_bar {
    padding: 0px;
    height: 100%;
    width: 100%;
    user-select: none;
    background-color: rgb(80, 80, 80);
    display: flex;
    flex-direction: row;
    justify-content: center;

}

// 按钮组
.h_button_group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    // 水平导航按钮
    .h_button {
        margin-right: 3px;
        min-width: 80px;
        height: 25px;
        font-size: medium;
        text-align: center;
        background-color: rgb(80, 80, 80);
        color: rgb(0, 0, 0);
        border-bottom: 5px solid rgb(80, 80, 80);
        cursor: pointer; // 小手指

        &:hover {
            color: rgb(218, 218, 218);
            border-bottom: 5px solid rgb(0, 0, 255);
        }
    }

    // 激活
    .h_active {
        background-color: rgb(118, 118, 118);
        color: rgb(218, 218, 218);
        border-bottom: 5px solid #1d9f00;
    }
}

/* 水平导航列表 */
.h_list_horizontal {
    margin: 0px;
    padding: 0px;
    max-height: 25px;
    width: 100%;
    user-select: none;
    background-color: rgb(0, 0, 0);

    // 水平导航按钮
    .navigation_button {
        margin-left: 10px;
        margin-right: 10px;
        padding: 0px;
        width: 70px;
        height: 25px;
        font-size: medium;
        text-align: center;
        background-color: rgb(50, 50, 50);
        color: rgb(218, 218, 218);
        border-bottom: 5px solid rgb(0, 0, 0);
        cursor: pointer; // 小手指

        &:hover {
            color: rgb(255, 255, 255);
            border-bottom: 5px solid rgb(0, 0, 255);
        }

        &.h_active {
            background-color: rgb(80, 80, 80);
            color: rgb(0, 0, 0);
            border-bottom: 5px solid #1d9f00;
        }
    }

    &:hover {
        cursor: s-resize; //箭头↕
    }
}
</style>